package com.qf.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.mapper.DtsCouponUserMapper;
import com.qf.pojo.DtsCouponUser;
import com.qf.service.DtsCouponUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Zwnan
 */
@Service
public class DtsCouponUserServiceImpl implements DtsCouponUserService {

    @Autowired
    private DtsCouponUserMapper dtsCouponUserMapper;
    @Override
    public IPage<DtsCouponUser> findPage(Integer page, Integer limit, String sort, String order, String couponId) {
        IPage<DtsCouponUser> iPage = new Page<>(page,limit);
        QueryWrapper<DtsCouponUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("deleted", false)
                .eq("coupon_id", couponId);
        return dtsCouponUserMapper.selectPage(iPage,queryWrapper) ;
    }
}
